package com.xinzhidi.web.netty.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.xinzhidi.common.annotation.Excel;
import com.xinzhidi.common.core.domain.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.util.Date;


/**
 * 指令发送对象 device_instruction
 *
 * @author cx
 * @date 2023-06-16
 */
@ApiModel(value = "指令发送对象")
@Data
@EqualsAndHashCode(callSuper = false)
@TableName("device_instruction")
public class DeviceInstruction extends BaseEntity {
    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "主键id")
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    @ApiModelProperty(value = "业务类型（1：手动抄表  2：自动抄表 3：初始设置  4：平衡调控 5：存档恢复 6：其他指令下发）")
    private Integer businessType;

    @ApiModelProperty(value = "dtuId")
    @Excel(name = "dtuId")
    private Long dtuId;

    @ApiModelProperty(value = "协议类型 1：户用阀门协议 2：单元阀门协议 3：室温采集器协议 4：户用热量表协议 5：单元热量表协议")
    private String protocolType;

    @ApiModelProperty(value = "协议名称")
    @Excel(name = "协议名称")
    private String protocolName;

    @ApiModelProperty(value = "指令类型")
    @Excel(name = "指令类型")
    private String instructType;

    @ApiModelProperty(value = "指令名称")
    @Excel(name = "指令名称")
    private String instructName;

    @ApiModelProperty(value = "小区id")
    @Excel(name = "小区id")
    @TableField(updateStrategy = FieldStrategy.IGNORED)
    private Long plotId;

    @ApiModelProperty(value = "楼栋id")
    @Excel(name = "楼栋id")
    @TableField(updateStrategy = FieldStrategy.IGNORED)
    private Long buildId;

    @ApiModelProperty(value = "单元id")
    @Excel(name = "单元id")
    @TableField(updateStrategy = FieldStrategy.IGNORED)
    private Long unitId;

    @ApiModelProperty(value = "住户id")
    @Excel(name = "住户id")
    @TableField(updateStrategy = FieldStrategy.IGNORED)
    private Long householdId;

    @ApiModelProperty(value = "地址域")
    @Excel(name = "地址域")
    private String address;

    @ApiModelProperty(value = "指令集合(十六进制)")
    @Excel(name = "指令集合(十六进制)")
    private String instructionSet;

    @ApiModelProperty(value = "回复数据（十六进制）")
    private String recoverMessage;

    @ApiModelProperty(value = "设备数据")
    @Excel(name = "设备数据")
    private String jsonData;

    @ApiModelProperty(value = "可重连次数")
    private Integer exceedTimes;

    @ApiModelProperty(value = "已发送次数")
    private Integer sendTimes;

    @ApiModelProperty(value = "状态（0：待发送 1：已发送 2：发送成功  3：发送失败  4：回复正常 5：回复异常  6：回复超时）")
    @Excel(name = "状态", readConverterExp = "0=：待发送,1=：已发送,2=：发送成功,3=：发送失败,4=：回复正常,5=：回复异常,6=：回复超时")
    private String status;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(value = "消息发送失败时间")
    private Date sendFailTime;

    @ApiModelProperty(value = "是否有业务（0：有  1：没有  默认0）")
    private String businessFlag;

}
